package com.yonyou.cyxdms.sysAuth.service.dto.dealer;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;

import java.io.Serializable;


/**
 * <p>
 *
 * </p>
 *
 * @author duxiaoguang
 * @since 2019-09-04
 */

public class MsgTemplateDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 模板id
     */
    private Integer templateId;
    /**
     * 模板code
     */
    private Integer templateCode;
    /**
     * 模板name
     */
    private String templateName;
    /**
     * url
     */
    private String tzUrl;

    /**
     * 模板内容
     */
    private String templateDesc;
    /**
     * 模板状态 0-无效；1-有效
     */
    private Integer templateStatus;

    private long createdAt;

    private long updatedAt;


    public MsgTemplateDTO() {
        super();
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getTzUrl() {
        return tzUrl;
    }

    public void setTzUrl(String tzUrl) {
        this.tzUrl = tzUrl;
    }

    @Override
    public String toString() {
        return "MsgTemplateDTO{" +
                "templateId=" + templateId +
                ", templateCode=" + templateCode +
                ", templateName='" + templateName + '\'' +
                ", tzUrl='" + tzUrl + '\'' +
                ", templateDesc='" + templateDesc + '\'' +
                ", templateStatus=" + templateStatus +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                '}';
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public long getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(long createdAt) {
        this.createdAt = createdAt;
    }

    public long getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(long updatedAt) {
        this.updatedAt = updatedAt;
    }

    public void setUpdatedAt(Long updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getTemplateName() {
        return templateName;
    }

    public void setTemplateName(String templateName) {
        this.templateName = templateName;
    }

    public String getTemplateDesc() {
        return templateDesc;
    }

    public void setTemplateDesc(String templateDesc) {
        this.templateDesc = templateDesc;
    }

    public Integer getTemplateId() {
        return templateId;
    }


    public void setTemplateId(Integer templateId) {
        this.templateId = templateId;
    }


    public Integer getTemplateCode() {
        return templateCode;
    }


    public void setTemplateCode(Integer templateCode) {
        this.templateCode = templateCode;
    }


    public Integer getTemplateStatus() {
        return templateStatus;
    }


    public void setTemplateStatus(Integer templateStatus) {
        this.templateStatus = templateStatus;
    }


    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author duxiaoguang
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author duxiaoguang
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "templateId");
    }

}
